home *** CD-ROM | disk | FTP | other *** search
Text File | 2003-10-07 | 47.4 KB | 1,773 lines |
- function ext_XML_GET_TEXT()
- {
- return this.firstChild.nodeType != 3 ? null : this.firstChild.nodeValue;
- }
- function ext_XML_SET_TEXT(text)
- {
- this.firstChild.nodeValue = text;
- }
- function ActivityInfoItem()
- {
- }
- function ActivityInfo()
- {
- }
- function createIndexList(str, openTag, closeTag)
- {
- var len = str.length;
- var acntr = 0;
- var otag = openTag;
- var ctag = closeTag;
- var abi = [];
- var aei = [];
- while(acntr < len)
- {
- acntr = str.indexOf(otag,acntr);
- if(acntr == -1)
- {
- break;
- }
- abi.push(acntr);
- acntr += otag.length;
- }
- acntr = 0;
- while(acntr < len)
- {
- acntr = str.indexOf(ctag,acntr);
- if(acntr == -1)
- {
- break;
- }
- aei.push(acntr);
- acntr += ctag.length;
- }
- var rf = otag.length + ctag.length;
- var i = 0;
- while(i < abi.length)
- {
- if(i == 0)
- {
- aei[i] -= ctag.length - 1;
- }
- else
- {
- abi[i] -= rf * i;
- aei[i] -= rf * i + otag.length;
- }
- i++;
- }
- return {startIndex:abi,endIndex:aei,length:abi.length};
- }
- function createInstructionField(cnt, name, text)
- {
- text = simpleReplaceBlanks(text,"[:blank:]","[:/blank:]");
- var hasBold = text.indexOf("[:bold:]") != -1;
- if(cnt[name] == null)
- {
- var tmc = cnt.createEmptyMovieClip(name,1667);
- tmc.createTextField("content",1,0,0,0,0);
- }
- else
- {
- var tmc = cnt[name];
- tmc.swapDepths(1667);
- }
- tmc.isRemoveable = true;
- tmc.isRemovable = true;
- var tf = layoutInfo.instTextFormat;
- tmc.content.border = false;
- tmc.content.type = "dynamic";
- if(hasBold)
- {
- tmc.content.text = text.replace("[:bold:]","").replace("[:/bold:]","");
- }
- else
- {
- tmc.content.text = text;
- }
- tmc.content._height = 400;
- tmc.content.wordWrap = true;
- tmc.content.color = layoutInfo.instTextColor;
- tmc.content._width = 300;
- tmc.content.autoSize = true;
- tmc.content.selectable = false;
- tmc.content.setTextFormat(tf);
- tmc.content.embedFonts = true;
- if(hasBold)
- {
- var idxLists = createIndexList(text,"[:bold:]","[:/bold:]");
- var i = 0;
- while(i < idxLists.length)
- {
- tmc.content.setTextFormat(idxLists.startIndex[i],idxLists.endIndex[i],layoutInfo.instTextFormatBold);
- i++;
- }
- }
- return tmc;
- }
- function changeInstructionField(insField, newText)
- {
- createInstructionField(insField._parent,insField._name,newText);
- }
- function toggleLang()
- {
- if(PMSI.instructionLanguage == "Spanish")
- {
- PMSI.instructionLanguage = "English";
- }
- else
- {
- PMSI.instructionLanguage = "Spanish";
- }
- var instText = ai["instructions" + PMSI.instructionLanguage].text;
- if(instText != null)
- {
- var oldInstHeight = this.instructionField._height;
- changeInstructionField(this.instructionField,instText);
- var hdiff = this.instructionField._height - oldInstHeight;
- reposition(hdiff);
- }
- pencilHelper.swapLangs();
- }
- function reposition(hdiff)
- {
- var comp;
- var dupList = {};
- trace("******************************************");
- for(var mcn in this)
- {
- comp = this[mcn];
- if(comp.isMoveable && dupList[comp._name] == null)
- {
- trace("\t" + comp);
- trace("\t\t" + comp.getDepth());
- trace(hdiff);
- comp._y += hdiff;
- dupList[comp._name] = 1;
- }
- }
- trace("******************************************");
- }
- function simpleReplaceBlanks(str, stag, etag)
- {
- var cp = str.indexOf(stag);
- var ei = 0;
- while(cp != -1)
- {
- ei = str.indexOf(etag);
- str = str.substring(0,cp) + "_____" + str.substring(ei + etag.length);
- cp = str.indexOf(stag);
- }
- return str;
- }
- function loadActivity(fname)
- {
- t = getTimer();
- ai.load(fname);
- }
- function setActivityInfo(_ai)
- {
- ai = _ai;
- render();
- return true;
- }
- function render()
- {
- tabOrder = 4000;
- depth = 3000;
- delete this.answerList;
- this.answerList = new Array();
- if(parseInt(ai.type.text) == master.activityTypes.MULTI)
- {
- this.isMulti = true;
- }
- clearClip();
- var tableY = layoutInfo.box.y;
- var rightSideBuffer = layoutInfo.rightSideBuffer;
- var topBuffer = 0;
- if(master.hasVideoPlayer)
- {
- tableY = layoutInfo.temp4InstY;
- topBuffer = master.videoPlayer._height;
- rightSideBuffer = 250;
- }
- else if(master.hasMediaFrame)
- {
- rightSideBuffer = 250;
- }
- trace(this + ".render: called");
- var title_mc;
- var inst_mc;
- if(ai.titleSpanish)
- {
- title_mc = createTitleField(ai.titleSpanish);
- title_mc._x = layoutInfo.box.x;
- title_mc._y = layoutInfo.box.y + topBuffer;
- tableY = title_mc._y + title_mc._height;
- }
- if(ai.instructionsEnglish == null && ai.instructionsSpanish == null && !(ai.questions instanceof Array))
- {
- ai.activity.instructionsEnglish = {text:ai.questions.question.questionText.text};
- ai.activity.instructionsSpanish = {text:ai.questions.question.questionTextSpanish.text};
- delete ai.activity.questions.question.questionText;
- delete ai.activity.questions.question.questionTextSpanish;
- }
- if(ai.instructionsEnglish || ai.instructionsSpanish)
- {
- if(ai.instructionsEnglish != null)
- {
- var instText = ai.instructionsEnglish.text;
- }
- else
- {
- var instText = ai.instructionsSpanish.text;
- }
- pinstText = ai["instructions" + PMSI.instructionLanguage].text;
- instText = pinstText != null ? pinstText : instText;
- inst_mc = createInstructionField(this,"inst",instText);
- inst_mc._x = layoutInfo.box.x;
- inst_mc._y = title_mc == null ? tableY : title_mc._y + title_mc._height;
- trace("INST Y: " + inst_mc._y);
- tableY = inst_mc._y + inst_mc._height;
- this.instructionField = inst_mc;
- trace("tableY (first check): " + tableY);
- trace("INSTRUCTIONS?!?: " + inst_mc);
- hasInstructions = true;
- }
- else
- {
- hasInstructions = false;
- }
- if(ai.reference != null)
- {
- this._parent.showRefWinButton(layoutInfo.box.x,tableY);
- tableY += 15;
- }
- if(ai.videoFile == null && _parent.actNumber_mc._height > inst_mc._height + title_mc._height && hasInstructions)
- {
- tableY = _parent.actNumber_mc._y + _parent.actNumber_mc._height + 10;
- }
- tableY = tableY != 0 ? tableY : layoutInfo.box.y;
- trace("tableY: " + (tableY + topBuffer));
- trace("rightSideBuffer: " + rightSideBuffer);
- table = new TableClass(this);
- tables = new Array();
- atables = new Array();
- var isMultiQuestion = ai.questions.question instanceof Array;
- if(!(ai.questions.question instanceof Array))
- {
- var tempa = new Array();
- tempa.push(ai.questions.question);
- ai.questions.question = tempa;
- }
- var qlen = ai.questions.question.length;
- var qtc;
- var qtr;
- var answerChoices;
- var answerText;
- var question;
- var answer;
- var checkbox;
- var feedbackCheck;
- var mcon;
- var i = 0;
- while(i < qlen)
- {
- mcon = this.createEmptyMovieClip("qcon" + i,5000 + i);
- mcon.isMoveable = true;
- if(isMultiQuestion)
- {
- var questionText;
- var answerText1;
- var answerText2;
- questionText = ai.questions.question[i].questionText.text;
- if(questionText != null)
- {
- question = createQuestionField(mcon,i,replaceBlanks(questionText,8));
- }
- }
- tables[i] = new TableClass();
- qtc = new TableCell(question);
- qtr = new TableRow();
- qtr.addCell(qtc);
- tables[i].addRow(qtr);
- atables[i] = new TableClass();
- answerChoices = ai.questions.question[i].answerChoice;
- var j = 0;
- while(j < answerChoices.length)
- {
- answerText = answerChoices[j];
- feedbackCheck = mcon.attachMovie("check","correctcheck_" + i + "_" + j,depth++);
- feedbackCheck.isMoveable = true;
- checkbox = mcon.attachMovie("radiobutton","check_" + i + "_" + j,depth++);
- checkbox.isMoveable = true;
- checkbox.tabIndex = tabOrder++;
- answerList.push(checkbox);
- checkbox.feedbackCheck = feedbackCheck;
- checkbox.onRelease = answerOnRelease;
- checkbox.groupId = i;
- if(answerText.text == ai.questions.question[i].correctAnswer.text)
- {
- checkbox.isCorrectAnswer = true;
- }
- else
- {
- checkbox.isCorrectAnswer = false;
- }
- answer = createAnswerField(mcon,j,0,answerText);
- answer.isMoveable = true;
- qtr = new TableRow();
- qtc = new TableCell(feedbackCheck);
- qtr.addCell(qtc);
- qtc = new TableCell(checkbox);
- qtr.addCell(qtc);
- qtc = new TableCell(answer);
- qtr.addCell(qtc);
- atables[i].addRow(qtr);
- j++;
- }
- i++;
- }
- trace("tableY: " + tableY);
- var tableWidth = layoutinfo.MAX_WIDTH - rightSideBuffer;
- trace("layoutinfo.MAX_WIDTH: " + layoutinfo.MAX_WIDTH);
- trace("rightSideBuffer " + rightSideBuffer);
- trace("TABLE WIDTH: " + tableWidth);
- var ttab;
- var atab;
- var tableY1 = tableY;
- var tableY2 = tableY;
- var maxHeight = 0;
- var divsor = atables.length <= 3 ? 1 : 2;
- var i = 0;
- while(i < tables.length)
- {
- trace("i: " + i);
- ttab = tables[i];
- ttab.setPosition({x:0,y:0});
- ttab.setCellSpacing(6);
- ttab.init();
- ttab.setWidth(tableWidth / divsor);
- trace(ttab.height);
- tableY1 += ttab.height;
- trace("ASDA: " + ttab.width);
- atab = atables[i];
- atab.setPosition({x:0,y:ttab.height + 4});
- atab.setCellSpacing(6);
- atab.init();
- atab.setWidth(tableWidth / divsor);
- trace(atab.height);
- tableY1 += atab.height - 30;
- if(maxHeight < ttab.height + atab.height)
- {
- maxHeight = ttab.height + atab.height;
- }
- trace("maxHeight: " + maxHeight);
- i++;
- }
- biglayout = new TableClass();
- qtr = new TableRow();
- qtc = new TableCell(qcon0);
- qtr.addCell(qtc);
- qtc = new TableCell(qcon1);
- qtr.addCell(qtc);
- biglayout.addRow(qtr);
- qtr = new TableRow();
- qtc = new TableCell(qcon2);
- qtr.addCell(qtc);
- qtc = new TableCell(qcon3);
- qtr.addCell(qtc);
- biglayout.addRow(qtr);
- qtr = new TableRow();
- qtc = new TableCell(qcon4);
- qtr.addCell(qtc);
- qtc = new TableCell(qcon5);
- qtr.addCell(qtc);
- biglayout.addRow(qtr);
- biglayout.setPosition({x:layoutInfo.box.x,y:tableY});
- biglayout.setCellSpacing(20);
- biglayout.init();
- }
- function answerOnRollOver()
- {
- this.gotoAndStop("rollOver");
- }
- function answerOnRollOut()
- {
- this.gotoAndStop("rollOut");
- }
- function answerOnRelease()
- {
- if(this._parent._parent.isMulti)
- {
- var groupId = this.groupId;
- var gmem;
- var i = 0;
- while(true)
- {
- gmem = this._parent["check_" + groupId + "_" + i];
- if(gmem == null)
- {
- break;
- }
- trace(gmem);
- if(gmem != this)
- {
- gmem.gotoAndStop("notSelected");
- gmem.isSelected = false;
- }
- i++;
- }
- }
- trace(this + ": " + this.isSelected);
- if(!this.isSelected || this.isSelected == null)
- {
- this.isSelected = true;
- this.gotoAndStop("selected");
- }
- else
- {
- this.isSelected = false;
- this.gotoAndStop("notSelected");
- }
- }
- function createQuestionField(cnt, id, text)
- {
- var mc = cnt.createEmptyMovieClip("question" + id,depth++);
- mc.createTextField("content",1,0,0,0,0);
- var tf = layoutInfo.qTextFormatMULTI;
- mc.content.embedFonts = true;
- mc.content.border = TXT_DEBUG_SHOW_BORDERS;
- mc.content.type = "dynamic";
- mc.content.text = text;
- mc.content.autoSize = true;
- mc.content.setTextFormat(tf);
- mc.content.selectable = false;
- return mc;
- }
- function createAnswerField(cnt, id, subid, text)
- {
- var amc1 = cnt.createEmptyMovieClip("answer" + subid + "_" + id,depth++);
- amc1.createTextField("content",1,0,0,0,0);
- var tf2 = layoutInfo.answerTextFormat1;
- amc1.content.embedFonts = true;
- amc1.content.border = TXT_DEBUG_SHOW_BORDERS;
- amc1.content.type = "dynamic";
- amc1.content.text = text;
- amc1.content.autoSize = true;
- amc1.content.selectable = false;
- amc1.content.setTextFormat(tf2);
- return amc1;
- }
- function createAnswerSpacer(cnt, id)
- {
- var amcSpacer = cnt.createEmptyMovieClip("answerSpacer_" + id,depth++);
- amcSpacer.createTextField("content",1,0,0,0,0);
- var tf2 = layoutInfo.answerTextFormat1;
- amcSpacer.content.embedFonts = true;
- amcSpacer.content.border = TXT_DEBUG_SHOW_BORDERS;
- amcSpacer.content.type = "dynamic";
- amcSpacer.content.text = " ";
- amcSpacer.content.autoSize = true;
- amcSpacer.content.setTextFormat(tf2);
- amcSpacer.content.selectable = false;
- return amcSpacer;
- }
- function checkAnswers()
- {
- var qlen = ai.questions.question.length;
- var correct = 0;
- var clp;
- var i = 0;
- while(i < answerList.length)
- {
- clp = answerList[i];
- if(clp.isSelected && clp.isCorrectAnswer)
- {
- correct++;
- clp.feedbackCheck.gotoAndStop("correct");
- }
- else if(clp.isSelected && !clp.isCorrectAnswer)
- {
- clp.feedbackCheck.gotoAndStop("incorrect");
- }
- else
- {
- clp.feedbackCheck.gotoAndStop(1);
- }
- i++;
- }
- master.setFeedback(correct,qlen);
- }
- function createTitleField(txt)
- {
- var mc = this.createEmptyMovieClip("title",depth++);
- mc.createTextField("content",1,0,0,0,0);
- var tf = layoutInfo.titleTextFormat;
- mc.content.embedFonts = true;
- mc.content.border = false;
- mc.content.type = "dynamic";
- mc.content.text = txt;
- mc.content.setTextFormat(tf);
- mc.content.wordWrap = true;
- mc.content.color = layoutInfo.instTextColor;
- mc.content._width = 300;
- mc.content.autoSize = true;
- mc.content.selectable = false;
- return mc;
- }
- function highlightIncorrect(text)
- {
- }
- function clearClip()
- {
- layoutInfo.qMaxWidthPos = 0;
- layoutInfo.qMaxWidth = 0;
- layoutInfo.a1MaxWidth = 0;
- layoutInfo.a2MaxWidth = 0;
- for(var mc in this)
- {
- if(this[mc] != _parent && this[mc] != this)
- {
- this[mc].clear();
- this[mc].removeMovieClip();
- }
- }
- }
- function drawDebugBox()
- {
- this.lineStyle(1,16711680,100);
- this.drawRect(layoutInfo.box.x,layoutInfo.box.y,layoutInfo.MAX_WIDTH,layoutInfo.MAX_HEIGHT);
- }
- function replaceBlanks(s_str, maxlen)
- {
- trace("MAXLEN: " + maxlen);
- var str = s_str.toString();
- return replaceBlanksR(str,maxlen);
- }
- function replaceBlanksR(s_str, maxlen)
- {
- trace(s_str);
- var si = s_str.indexOf(TAGS.BLANK_OPEN);
- if(si == -1)
- {
- return s_str;
- }
- var ei = s_str.indexOf(TAGS.BLANK_CLOSE) + TAGS.BLANK_CLOSE.length;
- s_str = s_str.slice(0,si) + makeStringFromChar("_",maxlen) + s_str.slice(ei,s_str.length);
- return replaceBlanks(s_str,maxlen);
- }
- function makeStringFromChar(char, length)
- {
- var str = "";
- var i = 0;
- while(i < length)
- {
- str += char;
- i++;
- }
- return str;
- }
- if(_global.PMSI == null)
- {
- _global.PMSI = {};
- PMSI.VENDOR_NAME = "Purple Monkey Studios, Inc.";
- PMSI.DefList = {};
- }
- String.prototype.trim = function()
- {
- return this.rtrim().ltrim();
- };
- String.prototype.rtrim = function()
- {
- var i = this.length - 1;
- while(i >= 0 && this.charCodeAt(i) <= 32)
- {
- i--;
- }
- return this.substring(0,i + 1);
- };
- String.prototype.ltrim = function()
- {
- var i = 0;
- while(i < this.length && this.charCodeAt(i) <= 32)
- {
- i++;
- }
- return this.substring(i);
- };
- String.prototype.isWhiteSpace = function()
- {
- var i = 0;
- while(i < this.length)
- {
- if(this.charCodeAt(i) > 32)
- {
- return false;
- }
- i++;
- }
- return true;
- };
- String.prototype.toCharArray = function()
- {
- return this.split("");
- };
- Array.prototype.charArrayToString = function()
- {
- return this.join("");
- };
- String.prototype.reverse = function()
- {
- return this.split("").reverse().join("");
- };
- String.prototype.multiSplit = function()
- {
- var master;
- var dummy;
- var args;
- master = this.split(arguments[0]);
- var i = 1;
- while(i < arguments.length)
- {
- var j = 0;
- while(j < master.length)
- {
- dummy = master[j].split(arguments[i]);
- if(dummy.length > 1)
- {
- args = [j,1];
- args = args.concat(dummy);
- master.splice.apply(master,args);
- }
- j++;
- }
- i++;
- }
- return master;
- };
- String.prototype.replace = function(srch, repl)
- {
- return this.split(srch).join(repl);
- };
- XML.prototype.ELEMENT_NODE = 1;
- XML.prototype.TEXT_NODE = 3;
- XML.prototype._inorderItr = function(node, fnPtr)
- {
- var stack = new Array();
- var node = node;
- while(true)
- {
- if(node)
- {
- stack.push(node);
- node = node.firstChild;
- }
- else
- {
- node = stack.pop();
- if(!node)
- {
- break;
- }
- fnPtr(node);
- node = node.nextSibling;
- }
- }
- delete stack;
- };
- XMLNode.prototype._inorderItr = XML.prototype._inorderItr;
- XML.prototype._inorderRec = function(node, fnPtr)
- {
- function helperR(node_xml)
- {
- if(node_xml == null)
- {
- return undefined;
- }
- this.fnPtr(node_xml);
- helperR(node_xml.firstChild);
- helperR(node_xml.nextSibling);
- }
- var outer = this;
- helperR(node);
- };
- XMLNode.prototype._inorderRec = XML.prototype._inorderRec;
- XMLNode.prototype.addProperty("text",this.ext_XML_GET_TEXT,this.ext_XML_SET_TEXT);
- XML.prototype.addProperty("text",this.ext_XML_GET_TEXT,this.ext_XML_SET_TEXT);
- XML.prototype.getElementsByTagName = function(tagName)
- {
- function processNode(node)
- {
- if(node.nodeName != null && node.nodeName == tagName)
- {
- nodelist.push(node);
- }
- }
- var nodelist = new Array();
- this._inorderItr(this,processNode);
- return nodelist;
- };
- XMLNode.prototype.getElementsByTagName = XML.prototype.getElementsByTagName;
- XML.prototype.getElementsByTagNames = function()
- {
- function processNode(node)
- {
- var i = 0;
- while(i < args.length)
- {
- if(node.nodeName != null && node.nodeName == args[i])
- {
- trace("Found: " + args[i]);
- if(nodelists[i] == undefined)
- {
- nodelists[i] = new Array();
- }
- nodelists[i].push(node);
- break;
- }
- i++;
- }
- }
- var args = arguments;
- var nodelists = new Array(arguments.length);
- this._inorderItr(this,processNode);
- return nodelists;
- };
- XMLNode.prototype.getElementsByTagNames = XML.prototype.getElementsByTagNames;
- XML.prototype.getValueAtTagName = function(tagName)
- {
- function processNode(node)
- {
- if(node.nodeName != null && node.nodeName == tagName)
- {
- nodelist.push(node);
- }
- }
- var nodelist = new Array();
- var textValue = null;
- this._inorderItr(this,processNode);
- if(nodeList.length >= 1)
- {
- textValue = nodeList[0].text;
- }
- return textValue;
- };
- XMLNode.prototype.getValueAtTagName = XML.prototype.getValueAtTagName;
- XML.prototype.getAttribute = function(name)
- {
- return this.attributes[name];
- };
- XMLNode.prototype.getAttribute = XML.prototype.getAttribute;
- XML.prototype.setAttribute = function(name, value)
- {
- this.attributes[name] = value;
- };
- XMLNode.prototype.setAttribute = XML.prototype.setAttribute;
- XML.prototype.hasAttribute = function(name)
- {
- var attrs = this.attributes;
- for(var mc in attrs)
- {
- if(name == mc)
- {
- return true;
- }
- }
- return false;
- };
- XMLNode.prototype.hasAttribute = XML.prototype.hasAttribute;
- XML.prototype.removeAttribute = function(name)
- {
- var attr = this.attributes[name];
- delete this.attributes[name];
- return attr;
- };
- XMLNode.prototype.setAttribute = XML.prototype.setAttribute;
- XMLNode.prototype.getOwnerDocument = function()
- {
- var odc = this;
- var lastNode = this;
- while(odc)
- {
- lastNode = odc;
- odc = odc.parentNode;
- }
- return !(lastNode instanceof XML) ? null : lastNode;
- };
- XML.prototype.normalize = function()
- {
- function process(node)
- {
- nodeList.push(node);
- }
- var outer = this;
- var nodeList = new Array();
- this._inorderItr(this,process);
- var i = 0;
- while(i < nodeList.length)
- {
- var node = nodeList[i];
- if(node.nodeType == XML.prototype.TEXT_NODE && node.nodeValue.isWhiteSpace())
- {
- trace("removing node");
- node.removeNode();
- }
- else if(node.nodeType == XML.prototype.TEXT_NODE)
- {
- node.nodeValue = node.nodeValue.trim();
- }
- i++;
- }
- delete nodeList;
- };
- XMLNode.prototype.normalize = XML.prototype.normalize;
- XMLNode.prototype.getDepth = function()
- {
- var i = 0;
- var node = this;
- while(node)
- {
- node = node.parentNode;
- i++;
- }
- return i;
- };
- XML.prototype.getElementsWithAttribute = function(name, value)
- {
- function processNode(node)
- {
- if(value == null)
- {
- for(var mcz in node.attributes)
- {
- if(mcz == name)
- {
- nodeList.push(node);
- break;
- }
- }
- }
- else if(node.attributes[name] == value)
- {
- nodeList.push(node);
- }
- }
- if(name == null)
- {
- return undefined;
- }
- var nodeList = new Array();
- this._inorderItr(this,processNode);
- return nodeList;
- };
- XMLNode.prototype.getElementsWithAttribute = XML.prototype.getElementsWithAttribute;
- XMLNode.prototype.getPath = function(path)
- {
- function process(node)
- {
- trace(node.nodeName);
- if(node.nodeName != null && node.nodeName == currentPart && i < pathParts.length)
- {
- trace("Found: " + currentPart);
- partTable[i] = node.parentNode.getElementsByTagName(currentPart);
- currentPart = pathParts[++i];
- }
- }
- var i = 0;
- var pathParts = path.split("/");
- var currentPart = pathParts[i];
- var partTable = new Array();
- this._inorderItr(this,process);
- return partTable[partTable.length - 1];
- };
- XML.prototype.getPath = XMLNode.prototype.getPath;
- MovieClip.prototype.isLoading = function()
- {
- return this.getBytesLoaded() > 4 && this.getBytesTotal() > this.getBytesLoaded();
- };
- MovieClip.prototype.getPercentLoaded = function()
- {
- return Math.round(this.getBytesLoaded() / this.getBytesTotal() * 100);
- };
- MovieClip.prototype.isLoaded = function()
- {
- return !this.isLoading();
- };
- MovieClip.prototype._sol = function(f)
- {
- if(MovieClip.prototype.__onLoadHandler__ == undefined)
- {
- MovieClip.prototype.__onLoadHandler__ = {};
- }
- MovieClip.prototype.__onLoadHandler__[this] = f;
- };
- MovieClip.prototype._gol = function()
- {
- return MovieClip.prototype.__onLoadHandler__[this];
- };
- MovieClip.prototype.addProperty("onLoad",MovieClip.prototype._gol,MovieClip.prototype._sol);
- MovieClip.prototype._sod = function(f)
- {
- if(MovieClip.prototype.__onDataHandler__ == undefined)
- {
- MovieClip.prototype.__onDataHandler__ = {};
- }
- MovieClip.prototype.__onDataHandler__[this] = f;
- };
- MovieClip.prototype._god = function()
- {
- return MovieClip.prototype.__onDataHandler__[this];
- };
- MovieClip.prototype.addProperty("onData",MovieClip.prototype._god,MovieClip.prototype._sod);
- MovieClip.prototype.load = MovieClip.prototype.loadMovie;
- MovieClip.prototype.drawOval = function(x, y, radius, yRadius)
- {
- if(arguments.length < 3)
- {
- return undefined;
- }
- var theta;
- var xrCtrl;
- var yrCtrl;
- var angle;
- var angleMid;
- var px;
- var py;
- var cx;
- var cy;
- if(yRadius == undefined)
- {
- yRadius = radius;
- }
- theta = 0.7853981633974483;
- xrCtrl = radius / Math.cos(theta / 2);
- yrCtrl = yRadius / Math.cos(theta / 2);
- angle = 0;
- this.moveTo(x + radius,y);
- var i = 0;
- while(i < 8)
- {
- angle += theta;
- angleMid = angle - theta / 2;
- cx = x + Math.cos(angleMid) * xrCtrl;
- cy = y + Math.sin(angleMid) * yrCtrl;
- px = x + Math.cos(angle) * radius;
- py = y + Math.sin(angle) * yRadius;
- this.curveTo(cx,cy,px,py);
- i++;
- }
- };
- MovieClip.prototype.drawCircle = function(x, y, r)
- {
- this.drawOval(x,y,r);
- };
- MovieClip.prototype.drawSquare = function(x, y, w)
- {
- this.drawRect(x,y,w,w);
- };
- MovieClip.prototype.drawEgg = function(x, y, r)
- {
- var rx = r / 1.618;
- var ry = r;
- var ry1 = 2 * ry * 0.618;
- var ry2 = 2 * ry * 0.382;
- this.moveTo(x + rx,y);
- this.curveTo(rx + x,-0.4142 * ry1 + y,0.7071 * rx + x,-0.7071 * ry1 + y);
- this.curveTo(0.4142 * rx + x,- ry1 + y,x,- ry1 + y);
- this.curveTo(-0.4142 * rx + x,- ry1 + y,-0.7071 * rx + x,-0.7071 * ry1 + y);
- this.curveTo(- rx + x,-0.4142 * ry1 + y,- rx + x,y);
- this.curveTo(- rx + x,0.4142 * ry2 + y,-0.7071 * rx + x,0.7071 * ry2 + y);
- this.curveTo(-0.4142 * rx + x,ry2 + y,x,ry2 + y);
- this.curveTo(0.4142 * rx + x,ry2 + y,0.7071 * rx + x,0.7071 * ry2 + y);
- this.curveTo(rx + x,0.4142 * ry2 + y,rx + x,y);
- };
- MovieClip.prototype.drawRect = function(x, y, w, h, cornerRadius)
- {
- if(arguments.length < 4)
- {
- return undefined;
- }
- if(cornerRadius > 0)
- {
- var theta;
- var angle;
- var cx;
- var cy;
- var px;
- var py;
- if(cornerRadius > Math.min(w,h) / 2)
- {
- cornerRadius = Math.min(w,h) / 2;
- }
- theta = 0.7853981633974483;
- this.moveTo(x + cornerRadius,y);
- this.lineTo(x + w - cornerRadius,y);
- angle = -1.5707963267948966;
- cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- angle += theta;
- cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- this.lineTo(x + w,y + h - cornerRadius);
- angle += theta;
- cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- angle += theta;
- cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- this.lineTo(x + cornerRadius,y + h);
- angle += theta;
- cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- angle += theta;
- cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- this.lineTo(x,y + cornerRadius);
- angle += theta;
- cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- angle += theta;
- cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
- px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
- py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
- this.curveTo(cx,cy,px,py);
- }
- else
- {
- this.moveTo(x,y);
- this.lineTo(x + w,y);
- this.lineTo(x + w,y + h);
- this.lineTo(x,y + h);
- this.lineTo(x,y);
- }
- };
- MovieClip.prototype.getCenterPoint = function()
- {
- return {x:this._width / 2,y:this._height / 2};
- };
- MovieClip.prototype.drawDebugBorderD = function()
- {
- this.lineStyle(1,0,25);
- var x;
- var y = 0;
- var w = this._width;
- var h = this._height;
- this.moveTo(x,y);
- this.lineTo(x + w,y);
- this.lineTo(x + w,y + h);
- this.lineTo(x,y + h);
- this.lineTo(x,y);
- };
- MovieClip.prototype.drawUnderline = function(len)
- {
- len = len != null ? len : this._width;
- this.moveTo(0,this._height);
- this.lineTo(len,this._height);
- };
- if(PMSI.DepthManager == undefined)
- {
- PMSI.DepthManager = {};
- PMSI.DepthManager._$depth = 0;
- PMSI.DepthManager.getNextDepth = function()
- {
- var next_depth = ++this._$depth;
- while(this._$depthsClaimed["dc" + next_depth])
- {
- next_depth = ++this._$depth;
- }
- return next_depth;
- };
- PMSI.DepthManager.reserveDepth = function(d)
- {
- if(this._$depthsClaimed == null)
- {
- this._$depthsClaimed = {};
- }
- if(d == null)
- {
- var d = ++this._$depth;
- }
- while(this._$depthsClaimed["dc" + d])
- {
- d++;
- }
- this._$depthsClaimed["dc" + d] = d;
- return d;
- };
- }
- ActivityInfoItem.prototype.toString = function()
- {
- return this.text;
- };
- ActivityInfo.prototype.getIdString = function(separator)
- {
- var sep = separator != null ? separator : ".";
- var idStr = "C" + this.activity.course + sep;
- idStr += "U" + this.activity.unit + sep;
- idStr += "S" + this.activity.section + sep;
- idStr += this.activity.topic + sep;
- if(this.activity.topicSet)
- {
- idStr += this.activity.topicSet + sep;
- }
- idStr += this.activity.difficultyLevel + this.activity.number.text;
- return idStr;
- };
- ActivityInfo.prototype.getId = ActivityInfo.prototype.getIdString;
- ActivityInfo.prototype.getType = function()
- {
- return this.activity.type;
- };
- ActivityInfo.prototype.hasAudio = function()
- {
- return this.activity.audioFile == null ? false : true;
- };
- ActivityInfo.prototype.hasVideo = function()
- {
- return this.activity.videoFile == null ? false : true;
- };
- ActivityInfo.prototype.hasPicture = function()
- {
- return this.activity.artFile == null ? false : true;
- };
- ActivityInfo.prototype.setResolve = function()
- {
- this.__resolve = ActivityInfo.prototype._myResolve;
- };
- ActivityInfo.prototype._myResolve = function(name)
- {
- return this.activity[name];
- };
- ActivityInfo.prototype.getBytesLoaded = function()
- {
- return this.xmlSource.getBytesLoaded();
- };
- ActivityInfo.prototype.getBytesTotal = function()
- {
- return this.xmlSource.getBytesTotal();
- };
- ActivityInfo.prototype.load = function(url)
- {
- this._reset();
- this.xmlSource = new XML();
- var x = this.xmlSource;
- x.parent = this;
- x.ignoreWhite = true;
- x.createAttributeArray = function(attrs)
- {
- };
- x.onLoad = function(success)
- {
- function helperR(node_xml, obj)
- {
- if(node_xml == null)
- {
- return undefined;
- }
- var nName = node_xml.nodeName;
- if(nName == "number")
- {
- nName = "activityNumber";
- }
- if(nName != null && obj[nName] == null)
- {
- var newObj = new ActivityInfoItem();
- newObj.text = node_xml.text.trim();
- if(node_xml.attributes)
- {
- trace("creating new attributes array");
- newObj.attributes = {};
- for(var oname in node_xml.attributes)
- {
- newObj.attributes[oname] = node_xml.attributes[oname];
- }
- }
- obj[nName] = newObj;
- }
- else if(!(obj[nName] instanceof Array) && obj[nName] != null)
- {
- var temp = obj[nName];
- obj[nName] = [];
- obj[nName].push(temp);
- }
- var childObject = obj[nName];
- if(childObject instanceof Array)
- {
- var newObj = new ActivityInfoItem();
- newObj.text = node_xml.text.trim();
- if(node_xml.attributes)
- {
- trace("creating new attributes array");
- newObj.attributes = {};
- for(var oname in node_xml.attributes)
- {
- newObj.attributes[oname] = node_xml.attributes[oname];
- }
- }
- childObject = newObj;
- obj[nName].push(childObject);
- }
- helperR(node_xml.firstChild,childObject);
- helperR(node_xml.nextSibling,obj);
- }
- if(success)
- {
- helperR(this.firstChild,this.parent);
- this.parent.setResolve();
- }
- this.parent.onLoad(success);
- };
- x.load(url);
- };
- ActivityInfo.prototype._reset = function()
- {
- delete this.xmlSource;
- delete this.__resolve;
- delete this.activity;
- };
- TableClass = function(parent)
- {
- this.parent = parent;
- this.reduceTextFields = true;
- this.rows = [];
- this.maxCellDims = {width:0,height:0};
- this.cellPadding = 4;
- this.cellSpacing = 4;
- this.colWidthMaxs = [];
- this.colPercentTable = [];
- this.borderSize = 1;
- this.width = 0;
- this.height = 0;
- this.oldWidth = this.width;
- this.oldHeight = this.oldHeight;
- this.originalWidth = 0;
- this.x = 0;
- this.y = 0;
- this.alteredColumns = {};
- var dep = PMSI.DepthManager.getNextDepth();
- this.borderClip = parent.createEmptyMovieClip("TableClassBorder" + dep,dep);
- };
- TableClass.prototype.setPosition = function(position)
- {
- this.x = position.x;
- this.y = position.y;
- };
- TableClass.prototype.getPosition = function()
- {
- return {x:this.x,y:this.y};
- };
- TableClass.prototype.setBorder = function(bsize)
- {
- this.borderSize = bsize;
- };
- TableClass.prototype.addRow = function(newRow)
- {
- this.rows.push(newRow);
- var cells = newRow.cells;
- var cellCount = cells.length;
- var cwms = this.colWidthMaxs;
- var cw = null;
- var newWidth = 0;
- var con = null;
- var c = 0;
- while(c < cellCount)
- {
- con = cells[c].getContent();
- cw = con == null ? cells[c].width : con._width;
- if(cwms[c] == null)
- {
- cwms[c] = cw;
- }
- else
- {
- cwms[c] = cw <= cwms[c] ? cwms[c] : cw;
- }
- newWidth += cwms[c];
- c++;
- }
- this.originalWidth = newWidth;
- this.width = newWidth;
- trace("NEW WIDTH: " + this.width);
- };
- TableClass.prototype.addRowSpacer = function(height, width, numCols)
- {
- if(numCols == null && this.rows.length == 0)
- {
- return undefined;
- }
- numCols = this.rows[0].cells.length;
- var spacerRow = new TableRow();
- var spacerCell = null;
- var i = 0;
- while(i < numCols)
- {
- spacerCell = new TableCell();
- spacerCell.height = height;
- spacerCell.width = width;
- spacerRow.addCell(spacerCell);
- i++;
- }
- this.addRow(spacerRow);
- };
- TableClass.prototype.setCellPadding = function(cellPadding)
- {
- this.cellPadding = cellPadding;
- this.redraw();
- };
- TableClass.prototype.setCellSpacing = function(cellSpacing)
- {
- this.cellSpacing = cellSpacing;
- this.redraw();
- };
- TableClass.prototype.setWidth = function(width)
- {
- this.oldWidth = this.width;
- this.width = width;
- this._recalcDimensions(width);
- this.redraw();
- this.redraw();
- };
- TableClass.prototype.setHeight = function(height)
- {
- this.oldHeight = this.height;
- this.height = height;
- this.redraw();
- };
- TableClass.prototype.redraw = function()
- {
- this.borderClip.clear();
- var rows = this.rows;
- var rc = rows.length;
- var tmdims = this.maxCellDims;
- var x;
- var y;
- var r;
- var cc;
- var con;
- var cols;
- var rmdims;
- var cell;
- var cmax;
- var offset;
- var voffset;
- var cwid;
- var wprec;
- var newwid;
- var lastColMax = null;
- var cpad = this.cellPadding;
- var cspace = this.cellSpacing;
- var r = 0;
- while(r < rc)
- {
- cols = rows[r].cells;
- cc = cols.length;
- rmdims = rows[r - 1].maxCellDims;
- if(r == 0)
- {
- y = this.y;
- }
- else
- {
- y += rmdims.height + this.cellSpacing;
- }
- var c = 0;
- while(c < cc)
- {
- cell = cols[c];
- con = cell.getContent();
- cwid = this.colWidthMaxs[c];
- this._resizeTextfield(con,cwid);
- if(cell.halign == "right")
- {
- offset = cwid - con._width;
- }
- else if(cell.halign == "center")
- {
- offset = (cwid - con._width) / 2;
- }
- else
- {
- offset = 0;
- }
- if(cell.valign == "bottom")
- {
- voffset = rows[r].maxCellDims.height - con._height;
- }
- else if(cell.valign == "center")
- {
- voffset = (rows[r].maxCellDims.height - con._height) / 2;
- }
- else
- {
- voffset = 0;
- }
- if(c == 0)
- {
- x = this.x;
- lastColMax = cwid;
- }
- else
- {
- cmax = lastColMax;
- x += cmax + this.cellSpacing;
- }
- con._x = x + offset;
- con._y = y + voffset;
- if(this.borderSize > 0)
- {
- this.borderClip.lineStyle(this.borderSize,10066329,100);
- this.borderClip.drawRect(x,y,cwid,rows[r].maxCellDims.height);
- }
- lastColMax = cwid;
- c++;
- }
- r++;
- }
- this._recalcHeights();
- };
- TableClass.prototype._resizeTextfield = function(oIns, w, h)
- {
- var txt = oIns.content;
- if(txt._width > w)
- {
- txt.wordWrap = true;
- txt._width = w;
- txt._width = Math.round(txt._width);
- trace("text width: " + txt.textWidth);
- if(this.reduceTextFields)
- {
- var h = txt._height;
- var w = txt._width;
- var old_w = 0;
- var txtWidth = txt.textWidth;
- var i = w;
- while(h == txt._height)
- {
- if(i <= 0)
- {
- break;
- }
- if(txt.textWidth < txtWidth)
- {
- break;
- }
- txt._width--;
- i--;
- }
- txt._width = txt._width + 1;
- }
- }
- oIns._width = txt._width;
- };
- TableClass.prototype._recalcHeights = function()
- {
- var rows = this.rows;
- var rc = rows.length;
- var cc;
- var cols;
- var cell;
- this.height = 0;
- var r = 0;
- while(r < rc)
- {
- cols = rows[r].cells;
- cc = cols.length;
- var c = 0;
- while(c < cc)
- {
- cell = cols[c];
- rows[r]._checkMaxCellDims(cell);
- this.height += rows[r].maxCellDims.height;
- c++;
- }
- r++;
- }
- };
- TableClass.prototype._findLargestColumn = function()
- {
- var largestId;
- var largest;
- var cmaxs = this.colWidthMaxs;
- var i = 0;
- while(i < cmaxs.length)
- {
- trace("finding largest: " + cmaxs[i]);
- if(largest < cmaxs[i])
- {
- largest = cmaxs[i];
- largestId = i;
- }
- i++;
- }
- return largestId;
- };
- TableClass.prototype._recalcDimensions = function(newWidth)
- {
- var cw = this._getTableWidth();
- if(newWidth > cw)
- {
- return undefined;
- }
- trace("\n\n----");
- trace("TableClass.prototype._recalcDimensions:");
- trace("current width: " + cw + ", new width: " + newWidth);
- delete this.alteredColumns;
- this.alteredColumns = {};
- this._resizeTableR(cw,newWidth);
- var addback = newWidth - this._getTableWidth();
- var cmaxs = this.colWidthMaxs;
- var prc;
- var cmax = 0;
- var acc = 0;
- for(var nm in this.alteredColumns)
- {
- trace("ALTERED COLUMNS: " + nm);
- if(!isNaN(nm))
- {
- acc++;
- }
- }
- for(var colid in this.alteredColumns)
- {
- trace("Addback: " + colid + ", " + addback / acc);
- this.colWidthMaxs[parseInt(colid)] = this.colWidthMaxs[parseInt(colid)] + addback / acc;
- }
- if(addback / acc > 0)
- {
- }
- this.width = newWidth;
- };
- TableClass.prototype._resizeTableR = function(lastWidth, targetWidth)
- {
- if(lastWidth <= targetWidth)
- {
- return undefined;
- }
- var largest;
- var largestId = 0;
- var cmaxs = this.colWidthMaxs;
- var i = 0;
- while(i < cmaxs.length)
- {
- trace("finding largest: " + cmaxs[i]);
- if(largest < cmaxs[i])
- {
- largest = cmaxs[i];
- largestId = i;
- }
- i++;
- }
- var prc = largest / lastWidth;
- trace("prc: " + prc);
- var ncw = largest * prc;
- cmaxs[largestId] = ncw;
- this.alteredColumns[largestId] = largestId;
- trace("\n\nAFTER:");
- trace("new largest: " + ncw);
- trace("lastWidth: " + lastWidth);
- trace("largest: " + largest);
- trace("targetWidth: " + targetWidth);
- trace("nextWidth: " + (lastWidth - (largest - ncw)));
- if(prc == 1)
- {
- cmax[largestId] = targetWidth;
- return undefined;
- }
- this._resizeTableR(lastWidth - (largest - ncw),targetWidth);
- };
- TableClass.prototype._getTableWidth = function()
- {
- var width = 0;
- var lasti = this.colWidthMaxs.length - 1;
- var i = 0;
- while(i < this.colWidthMaxs.length)
- {
- width += this.colWidthMaxs[i];
- i++;
- }
- return width;
- };
- TableClass.prototype.init = function()
- {
- this.redraw();
- };
- TableRow = function()
- {
- this.cells = [];
- this.maxCellDims = {width:0,height:0};
- };
- TableRow.prototype.addCell = function(cell)
- {
- this.cells.push(cell);
- var cc = cell.getContent();
- var cw = cc == null ? cell.width : cc._width;
- var ch = cc == null ? cell.height : cc._height;
- var mw = this.maxCellDims.width;
- var mh = this.maxCellDims.height;
- this.maxCellDims.width = cw <= mw ? mw : cw;
- this.maxCellDims.height = ch <= mh ? mh : ch;
- };
- TableRow.prototype._checkMaxCellDims = function(cell)
- {
- var cc = cell.getContent();
- var cw = cc == null ? cell.width : cc._width;
- var ch = cc == null ? cell.height : cc._height;
- var mw = this.maxCellDims.width;
- var mh = this.maxCellDims.height;
- this.maxCellDims.width = cw <= mw ? mw : cw;
- this.maxCellDims.height = ch <= mh ? mh : ch;
- };
- TableCell = function(content)
- {
- this.content = content;
- };
- TableCell.prototype.setContent = function(content)
- {
- this.content = content;
- };
- TableCell.prototype.getContent = function()
- {
- return this.content;
- };
- TableCell.prototype.setWidth = function(width, isPercent)
- {
- this.widthIsPercent = isPercent != null ? true : false;
- this.width = width;
- };
- TableCell.prototype.setHeight = function(height, isPercent)
- {
- this.heightIsPercent = isPercent != null ? true : false;
- this.height = height;
- };
- TableCell.prototype.setHAlign = function(halign)
- {
- this.halign = halign;
- };
- TableCell.prototype.setVAlign = function(valign)
- {
- this.valign = valign;
- };
- mediaFrame._visible = false;
- stop();
- var TXT_DEBUG_SHOW_BORDERS = false;
- var testFile1 = "activities/data/c3.u5.s1.gr.a2.xml";
- if(_parent)
- {
- master = _parent;
- }
- else
- {
- master = this;
- }
- if(master.layoutInfo == null)
- {
- var layoutInfo = {};
- layoutInfo.titleTextColor = 3636920;
- layoutInfo.answerRollOverColor = 16695085;
- layoutInfo.answerRollOutColor = 3636920;
- layoutInfo.answerSelectColor = 2309272;
- layoutInfo.questionTextColor = 2309272;
- layoutInfo.instTextColor = 2309272;
- layoutInfo.doAnswerFill = false;
- layoutInfo.rightSideBuffer = 60;
- layoutInfo.box = {};
- layoutInfo.box.x = 260;
- layoutInfo.box.y = 94;
- layoutInfo.box.views = [];
- layoutInfo.box.widthWithBox = 300;
- layoutInfo.box.heightWithBox = 300;
- layoutInfo.box.widthWithoutBox = 300;
- layoutInfo.box.heightWithoutBox = 300;
- layoutinfo.MAX_WIDTH = 520;
- layoutInfo.MAX_HEIGHT = 380;
- layoutInfo.questionIndent = 30;
- layoutInfo.selectionRadius = 6;
- layoutInfo.drawSelectionCircle = true;
- layoutInfo.lineSpacing = 5;
- layoutInfo.selectionBorderThickness = 1;
- layoutInfo.instTextFormat = new TextFormat();
- layoutInfo.instTextFormat.font = "Formata_Normal";
- layoutInfo.instTextFormat.size = 12;
- layoutInfo.instTextFormat.color = layoutInfo.instTextColor;
- layoutInfo.qTextFormat = new TextFormat();
- layoutInfo.qTextFormat.font = "Formata_Normal";
- layoutInfo.qTextFormat.size = 12;
- layoutInfo.qTextFormat.color = layoutInfo.questionTextColor;
- layoutInfo.qTextFormat.align = "right";
- layoutInfo.answerTextFormat1 = new TextFormat();
- layoutInfo.answerTextFormat1.font = "Formata_Normal";
- layoutInfo.answerTextFormat1.size = 12;
- layoutInfo.answerTextFormat1.color = layoutInfo.answerRollOutColor;
- layoutInfo.answerTextFormat2 = new TextFormat();
- layoutInfo.answerTextFormat2.font = "Formata_Normal";
- layoutInfo.answerTextFormat2.size = 12;
- layoutInfo.answerTextFormat2.color = layoutInfo.answerRollOutColor;
- layoutInfo.titleTextFormat = new TextFormat();
- layoutInfo.titleTextFormat.font = "TriplexCondSerifBlack";
- layoutInfo.titleTextFormat.size = 24;
- layoutInfo.titleTextFormat.color = layoutInfo.titleTextColor;
- }
- else
- {
- layoutInfo = master.layoutInfo;
- }
- layoutInfo.temp4InstWidth = 250;
- layoutInfo.temp4InstY = 0;
- var ai = new ActivityInfo();
- ai._parent = this;
- ai.onLoad = function(success)
- {
- trace("id: " + this.getIdString());
- trace("type: " + this.type);
- var i = 0;
- while(i < this.questions.question.length)
- {
- trace(i + 1 + ". " + this.questions.question[i].questionText);
- i++;
- }
- this._parent.render();
- trace("Time: " + (getTimer() - t) / 1000);
- };
- if(_parent == null)
- {
- loadActivity(testFile1);
- }
- answer.onRelease = function()
- {
- checkAnswers();
- };
- answer.onRollOver = function()
- {
- this.gotoAndStop("rollOver");
- };
- answer.onRollOut = function()
- {
- this.gotoAndStop("rollOut");
- };
- TAGS = {};
- TAGS.BLANK_OPEN = "[:blank:]";
- TAGS.BLANK_CLOSE = "[:/blank:]";
-